<?php 
$show_validator = true;
include TMPL_PATH.'public/header.phtml';
?>
<script type="text/javascript">
<!--
$(function(){
	$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
	$("#username").formValidator({onshow:"请输入用户名",onfocus:"用户名应该为2-20位之间"}).inputValidator({min:2,max:20,onerror:"用户名应该为2-20位之间"}).ajaxValidator({
		type : "get",
		url : "<?php echo U('user/public_checkname_ajx');?>",
		data :"",
		datatype : "html",
		async:'false',
		success : function(data){	
            if( data == "1" )
			{
                return true;
			}
            else
			{
                return false;
			}
		},
		buttons: $("#dosubmit"),
		onerror : "用户名已存在。",
		onwait : "请稍候..."
		});
	$("#password").formValidator({onshow:"请输入密码",onfocus:"密码应该为6-20位之间"}).inputValidator({min:6,max:20,onerror:"密码应该为6-20位之间"});
	$("#pwdconfirm").formValidator({onshow:"请输入确认密码",onfocus:"请输入两次密码不同。",oncorrect:"密码输入一致"}).compareValidator({desid:"password",operateor:"=",onerror:"请输入两次密码不同。"});
	$("#email").formValidator({onshow:"请输入E-mail",onfocus:"E-mail格式错误",oncorrect:"E-mail格式正确"}).regexValidator({regexp:"email",datatype:"enum",onerror:"E-mail格式错误"});
//	$("#mobile").formValidator({empty:true,onshow:"手机号不填请留空",onfocus:"手机号只能由1开头11位数字"}).regexValidator({regexp:"mobile",datatype:"enum",onerror:"手机号格式错误"});
//	$("#phone").formValidator({empty:true,onshow:"电话号码不填请留空,电话号码格式：（地区号-）用户号（-分机号）如010-66668888-123",onfocus:"电话号码格式错误"}).regexValidator({regexp:"mobile",datatype:"enum",onerror:"电话号码格式错误"});
})
//-->
</script>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <a href='<?php echo U('user/user_list');?>'><em>会员列表</em></a><span>|</span>
        <a href='javascript:;' class="on"><em>添加会员</em></a>
    </div>
</div>
<div class="pad_10">
<div class="common-form">
<form name="myform" action="__SELF__" method="post" id="myform">
<table width="100%" class="table_form contentWrap">
<tr>
<td width="80">用户名</td> 
<td><input type="text" name="username"  class="input-text" id="username"/></td>
</tr>
<tr>
<td width="80">First name</td> 
<td><input type="text" name="first_name"  class="input-text" id="first_name"/></td>
</tr>
<tr>
<td width="80">Last name</td> 
<td><input type="text" name="last_name"  class="input-text" id="last_name"/></td>
</tr>
<tr style="display:none">
<td width="80">姓名</td> 
<td><input type="text" name="nickname"  class="input-text" id="nickname"/></td>
</tr>
<tr>
<td>密码</td> 
<td><input type="password" name="password" id="password" class="input-text"/></td>
</tr>
<tr>
<td>确认密码</td> 
<td><input type="password" name="pwdconfirm" id="pwdconfirm" class="input-text"/></td>
</tr>
<tr>
<td>会员等级</td>
<td><select name="rank_id">
<?php 
if(isset($rankList) && $rankList){
	foreach($rankList as $rank){
?>
<option value="<?php echo $rank['id']?>"><?php echo $rank['name']?></option>
<?php 
}	}
?>
</select></td>
</tr>
<tr>
<td>E-mail</td>
<td><input type="text" name="email" value="" class="input-text" id="email" size="30"/></td>
</tr>
<tr>
<td>性别</td>
<td><input type="radio" name="gender" value="0" checked/> 保密
<input type="radio" name="gender" value="1"/> 男 
<input type="radio" name="gender" value="2"/> 女 </td>
</tr>
<tr>
<td>手机</td>
<td><input type="text" name="mobile" value="" class="input-text" id="mobile"/></td>
</tr>
<tr>
<td>固定电话</td>
<td><input type="text" name="phone" value="" class="input-text" id="phone"/></td>
</tr>

<tr>
<td>状态</td>
<td><input name="disabled" value="1" type="radio" checked/> 开启    
<input name="disabled" value="0"  type="radio" /> 禁用</td>
</tr>
</table>

    <div class="bk15"></div>
    <input name="dosubmit" type="submit" value="提交" class="button" id="dosubmit" />
</form>
</div>
</div>
</body>
</html>